import { BasicTableColumn } from '../typing'
import { useI18n } from '@/locales/useI18n'

const { t } = useI18n()

export function useTableList() {
  const actionsColumn: BasicTableColumn = {
    title: t('component.upload.operating'),
    dataIndex: 'actions',
    fixed: 'right',
    width: 170,
    align: 'center'
  }

  const createIndexColumn = function () {
    return {
      title: t('component.table.index'),
      width: 80,
      align: 'center',
      fixed: true,
      dataIndex: 'index'
    } as BasicTableColumn
  }

  const indexColumn: BasicTableColumn | undefined = createIndexColumn()

  return {
    actionsColumn,
    indexColumn
  }
}

export default useTableList